import instance from '../utils/request'

//获取所有收藏信息
export const getCollectionListService = () => {

    return instance.post('/collection/getAllCollection', null)

}

//删除收藏信息
export const deleteCollectionService = (uid, birdId) => {

    const param = new URLSearchParams();
    param.append('UID', uid);
    param.append('birdId', birdId);

    return instance.post('/collection/deleteCollection', param)

}

//根据id获取收藏信息
export const getCollectionListByIdService = (id) => {

    const param = new URLSearchParams();
    param.append('id', id);

    return instance.post('/collection/getCollectionById', param)

}

//根据birdId和UID获取收藏信息
export const getCollectionListByUIDAndBirdIdService = (uid, birdId) => {

    const param = new URLSearchParams();
    param.append('UID', uid);
    param.append('birdId', birdId);

    return instance.post('/collection/getCollectionByUIDAndBirdId', param)

}

//添加收藏信息
export const addCollectionService = (uid, birdId) => {

    const param = new URLSearchParams();
    param.append('UID', uid);
    param.append('birdId', birdId);
    param.append('birdUrl', "default")

    return instance.post('/collection/addCollection', param)

}

//根据UID获取所有收藏信息
export const getCollectionListByUIDService = (uid) => {

    const param = new URLSearchParams();
    param.append('UID', uid);

    return instance.post('/collection/getAllCollectionByUID', param)

}
